﻿@model List<HouseCrawler.Web.Models.HouseDashboard>
@using HouseCrawler.Web;

<div class="am-modal-dialog">
    @if (Model.Count == 0)
    {
        <div class="am-modal-hd">
            <a href="/Account">注册/登录</a>后可以直接在房源图标上点击"收藏图标"收藏房源.
            <br/>然后在个人中心可查看自己收藏的房源信息
            <br>(暂时只支持地图查看,即将支持房源列表.)
            <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
        </div>
    }
    else
    {
        <div class="am-modal-hd">
            房源列表
            <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
        </div>
        <div class="am-modal-bd">
            <ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-4 am-thumbnails" id="userHouseDashboards">
                @foreach (var cityGroup in Model.GroupBy(c => c.CityName))
                {
                    var cityName = cityGroup.First().CityName;
                    <li class="am-animation-slide-top">
                        <h2><a href="~/Home/UserCollection?cityname=@cityName" target="_blank">@cityName</a></h2>
                        <p>
                            @foreach (var cityHouseInfo in cityGroup)
                            {
                                var sum = cityHouseInfo.HouseSum > 9999 ? "9999+" : cityHouseInfo.HouseSum.ToString();
                                <a href="~/Home/UserCollection?cityname=@cityName&source=@cityHouseInfo.Source&intervalDay=14&houseCount=500" target="_blank">
                                    @cityHouseInfo.DisplaySource (@sum)
                                </a>
                                <br />

                            }
                        </p>
                    </li>
                }
            </ul>
        </div>
    }


</div>
